import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import { constantRoutes } from "./routeMap";
const router = createRouter({
    history: createWebHashHistory(), // createWebHistory为history模式  createWebHashHistory为hash模式
    routes: constantRoutes,
});
export default router;
// 重置路由
export function resetRouter() {
    router.getRoutes().forEach((route) => {
        const { path } = route;
        if (path && path !== "/login") {
            router.hasRoute(path) && router.removeRoute(path);
        }
    });
}
